package com.example.javaee_mybaits.mapper;


import com.example.javaee_mybaits.entity.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ArticleInfoMapper {


    // 多表查询
    @Select("SELECT ta.id,ta.title,ta.content,ta.uid,tb.username,tb.age,tb.gender " +
            "FROM articleinfo ta LEFT JOIN userinfo tb ON ta.uid = tb.id " +
            "WHERE ta.id = #{id}")
    ArticleInfo queryArticleInfo(Integer id);

}
